package com.y2.authprj;

import java.util.HashMap;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.gdglc.spring.biz.auth.StaffBiz;
import com.github.pagehelper.PageInfo;
import com.y2.authprj.bean.auth.model.StaffInfo;
import com.y2.authprj.exception.BizException;

public class TextByPage {

	//测试by辉
	/*public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
		StaffBiz staffService = (StaffBiz) context.getBean("staffService");
		StaffInfo s = new StaffInfo();
		RoleBiz roleBiz=(RoleBiz) context.getBean("RoleBiz");
		RoleInfo roleInfo=new RoleInfo();
		List<RoleInfo> roleInfos=null;
		try {
			roleInfos=roleBiz.findByRoleid(2);
		} catch (BizException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		//添加条件查询
		//s.setChnName("北大");
//		PageInfo<RoleInfo> queryByPage = roleBiz.findAllByName("用户", 5, 3);//(对象,第几页,每页几行) 
//		List<RoleInfo> list = queryByPage.getList();
		for (RoleInfo r : roleInfos) {
			System.out.println(r);
		}
//		System.out.println("查询到的记录数是:"+queryByPage.getTotal());
//		System.out.println("当前页是:"+queryByPage.getPageNum());
//		System.out.println("总页数是:"+queryByPage.getPages());
//		System.out.println("下一页是:"+queryByPage.getNextPage());
//		System.out.println("上一页是:"+queryByPage.getPrePage());
		
	}*/

}
